.class Lcom/estrongs/android/ui/drag/a$d;
.super Ljava/lang/Object;
.source "DragController.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/estrongs/android/ui/drag/a;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "d"
.end annotation


# instance fields
.field private a:Lcom/estrongs/android/ui/drag/e;

.field private b:J

.field private c:I

.field private d:I

.field private e:I

.field final synthetic f:Lcom/estrongs/android/ui/drag/a;


# direct methods
.method public constructor <init>(Lcom/estrongs/android/ui/drag/a;Lcom/estrongs/android/ui/drag/e;III)V
    .locals 0

    .line 1
    iput-object p1, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    iput-object p2, p0, Lcom/estrongs/android/ui/drag/a$d;->a:Lcom/estrongs/android/ui/drag/e;

    .line 3
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide p1

    iput-wide p1, p0, Lcom/estrongs/android/ui/drag/a$d;->b:J

    .line 4
    iput p3, p0, Lcom/estrongs/android/ui/drag/a$d;->c:I

    .line 5
    iput p4, p0, Lcom/estrongs/android/ui/drag/a$d;->d:I

    .line 6
    iput p5, p0, Lcom/estrongs/android/ui/drag/a$d;->e:I

    return-void
.end method

.method private a()I
    .locals 3

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v0}, Lcom/estrongs/android/ui/drag/a;->j(Lcom/estrongs/android/ui/drag/a;)Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    const/16 v1, 0x1e

    div-int/2addr v1, v0

    const/16 v0, 0xf

    const/4 v2, 0x5

    if-ge v1, v2, :cond_0

    const/4 v1, 0x5

    goto :goto_0

    :cond_0
    if-le v1, v0, :cond_1

    const/16 v1, 0xf

    :cond_1
    :goto_0
    return v1
.end method

.method private a(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
    .locals 6

    .line 2
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    invoke-direct {p0}, Lcom/estrongs/android/ui/drag/a$d;->a()I

    move-result v1

    add-int/2addr v0, v1

    .line 3
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v1

    invoke-direct {p0}, Lcom/estrongs/android/ui/drag/a$d;->a()I

    move-result v2

    add-int/2addr v1, v2

    .line 4
    sget-object v2, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    .line 5
    invoke-static {v0, v1, v2}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v2

    .line 6
    new-instance v3, Landroid/graphics/Canvas;

    invoke-direct {v3, v2}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V

    .line 7
    new-instance v4, Landroid/graphics/Paint;

    invoke-direct {v4}, Landroid/graphics/Paint;-><init>()V

    .line 8
    invoke-virtual {p2}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v5

    sub-int/2addr v0, v5

    int-to-float v0, v0

    const/4 v5, 0x0

    invoke-virtual {v3, p2, v0, v5, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    .line 9
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result p2

    sub-int/2addr v1, p2

    int-to-float p2, v1

    invoke-virtual {v3, p1, v5, p2, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    return-object v2
.end method

.method private b()I
    .locals 2

    .line 1
    iget v0, p0, Lcom/estrongs/android/ui/drag/a$d;->c:I

    invoke-direct {p0}, Lcom/estrongs/android/ui/drag/a$d;->a()I

    move-result v1

    mul-int v0, v0, v1

    const/16 v1, 0x1e

    if-le v0, v1, :cond_0

    const/16 v0, 0x1e

    :cond_0
    return v0
.end method


# virtual methods
.method a(FF)D
    .locals 0

    sub-float p1, p2, p1

    div-float/2addr p1, p2

    float-to-double p1, p1

    .line 10
    invoke-static {p1, p2}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide p1

    return-wide p1
.end method

.method public run()V
    .locals 10

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v0}, Lcom/estrongs/android/ui/drag/a;->f(Lcom/estrongs/android/ui/drag/a;)Lcom/estrongs/android/ui/drag/e;

    move-result-object v0

    const/4 v1, 0x0

    if-nez v0, :cond_0

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/ui/drag/a$d;->a:Lcom/estrongs/android/ui/drag/e;

    invoke-virtual {v0}, Lcom/estrongs/android/ui/drag/e;->c()V

    .line 3
    iput-object v1, p0, Lcom/estrongs/android/ui/drag/a$d;->a:Lcom/estrongs/android/ui/drag/e;

    return-void

    .line 4
    :cond_0
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    .line 5
    iget-wide v4, p0, Lcom/estrongs/android/ui/drag/a$d;->b:J

    sub-long/2addr v2, v4

    long-to-int v0, v2

    const/16 v2, 0x2bc

    if-ge v0, v2, :cond_1

    .line 6
    iget v1, p0, Lcom/estrongs/android/ui/drag/a$d;->d:I

    iget-object v2, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v2}, Lcom/estrongs/android/ui/drag/a;->f(Lcom/estrongs/android/ui/drag/a;)Lcom/estrongs/android/ui/drag/e;

    move-result-object v2

    invoke-virtual {v2}, Lcom/estrongs/android/ui/drag/e;->getRegistrationX()I

    move-result v2

    sub-int/2addr v1, v2

    .line 7
    iget v2, p0, Lcom/estrongs/android/ui/drag/a$d;->e:I

    iget-object v3, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v3}, Lcom/estrongs/android/ui/drag/a;->f(Lcom/estrongs/android/ui/drag/a;)Lcom/estrongs/android/ui/drag/e;

    move-result-object v3

    invoke-virtual {v3}, Lcom/estrongs/android/ui/drag/e;->getRegistrationY()I

    move-result v3

    sub-int/2addr v2, v3

    .line 8
    iget-object v3, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v3}, Lcom/estrongs/android/ui/drag/a;->g(Lcom/estrongs/android/ui/drag/a;)I

    move-result v3

    invoke-direct {p0}, Lcom/estrongs/android/ui/drag/a$d;->b()I

    move-result v4

    add-int/2addr v3, v4

    add-int/2addr v3, v1

    int-to-double v3, v3

    int-to-float v0, v0

    const/high16 v5, 0x442f0000    # 700.0f

    invoke-virtual {p0, v0, v5}, Lcom/estrongs/android/ui/drag/a$d;->a(FF)D

    move-result-wide v6

    .line 9
    invoke-direct {p0}, Lcom/estrongs/android/ui/drag/a$d;->b()I

    move-result v8

    add-int/2addr v1, v8

    int-to-double v8, v1

    invoke-static {v8, v9}, Ljava/lang/Double;->isNaN(D)Z

    mul-double v6, v6, v8

    invoke-static {v3, v4}, Ljava/lang/Double;->isNaN(D)Z

    sub-double/2addr v3, v6

    double-to-int v1, v3

    .line 10
    iget-object v3, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v3}, Lcom/estrongs/android/ui/drag/a;->h(Lcom/estrongs/android/ui/drag/a;)I

    move-result v3

    invoke-direct {p0}, Lcom/estrongs/android/ui/drag/a$d;->b()I

    move-result v4

    sub-int/2addr v3, v4

    add-int/2addr v3, v2

    int-to-double v3, v3

    invoke-virtual {p0, v0, v5}, Lcom/estrongs/android/ui/drag/a$d;->a(FF)D

    move-result-wide v5

    .line 11
    invoke-direct {p0}, Lcom/estrongs/android/ui/drag/a$d;->b()I

    move-result v0

    sub-int/2addr v2, v0

    int-to-double v7, v2

    invoke-static {v7, v8}, Ljava/lang/Double;->isNaN(D)Z

    mul-double v5, v5, v7

    invoke-static {v3, v4}, Ljava/lang/Double;->isNaN(D)Z

    sub-double/2addr v3, v5

    double-to-int v0, v3

    .line 12
    iget-object v2, p0, Lcom/estrongs/android/ui/drag/a$d;->a:Lcom/estrongs/android/ui/drag/e;

    invoke-virtual {v2, v1, v0}, Lcom/estrongs/android/ui/drag/e;->a(II)V

    .line 13
    iget-object v0, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v0}, Lcom/estrongs/android/ui/drag/a;->i(Lcom/estrongs/android/ui/drag/a;)Z

    move-result v0

    if-nez v0, :cond_2

    .line 14
    iget-object v0, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v0}, Lcom/estrongs/android/ui/drag/a;->e(Lcom/estrongs/android/ui/drag/a;)Landroid/os/Handler;

    move-result-object v0

    const-wide/16 v1, 0x19

    invoke-virtual {v0, p0, v1, v2}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    goto :goto_0

    .line 15
    :cond_1
    iget-object v0, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v0}, Lcom/estrongs/android/ui/drag/a;->f(Lcom/estrongs/android/ui/drag/a;)Lcom/estrongs/android/ui/drag/e;

    move-result-object v0

    invoke-virtual {v0}, Lcom/estrongs/android/ui/drag/e;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v0

    .line 16
    iget-object v2, p0, Lcom/estrongs/android/ui/drag/a$d;->a:Lcom/estrongs/android/ui/drag/e;

    invoke-virtual {v2}, Lcom/estrongs/android/ui/drag/e;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v2

    .line 17
    invoke-direct {p0, v0, v2}, Lcom/estrongs/android/ui/drag/a$d;->a(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;

    move-result-object v3

    .line 18
    iget-object v4, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v4}, Lcom/estrongs/android/ui/drag/a;->f(Lcom/estrongs/android/ui/drag/a;)Lcom/estrongs/android/ui/drag/e;

    move-result-object v4

    invoke-direct {p0}, Lcom/estrongs/android/ui/drag/a$d;->a()I

    move-result v5

    invoke-virtual {v4, v3, v5}, Lcom/estrongs/android/ui/drag/e;->a(Landroid/graphics/Bitmap;I)V

    .line 19
    iget-object v3, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v3}, Lcom/estrongs/android/ui/drag/a;->f(Lcom/estrongs/android/ui/drag/a;)Lcom/estrongs/android/ui/drag/e;

    move-result-object v3

    iget-object v4, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v4}, Lcom/estrongs/android/ui/drag/a;->g(Lcom/estrongs/android/ui/drag/a;)I

    move-result v4

    iget-object v5, p0, Lcom/estrongs/android/ui/drag/a$d;->f:Lcom/estrongs/android/ui/drag/a;

    invoke-static {v5}, Lcom/estrongs/android/ui/drag/a;->h(Lcom/estrongs/android/ui/drag/a;)I

    move-result v5

    invoke-virtual {v3, v4, v5}, Lcom/estrongs/android/ui/drag/e;->a(II)V

    .line 20
    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    .line 21
    invoke-virtual {v2}, Landroid/graphics/Bitmap;->recycle()V

    .line 22
    iget-object v0, p0, Lcom/estrongs/android/ui/drag/a$d;->a:Lcom/estrongs/android/ui/drag/e;

    invoke-virtual {v0}, Lcom/estrongs/android/ui/drag/e;->c()V

    .line 23
    iput-object v1, p0, Lcom/estrongs/android/ui/drag/a$d;->a:Lcom/estrongs/android/ui/drag/e;

    :cond_2
    :goto_0
    return-void
.end method
